<template>
  <!-- 顶部导航 -->
  <div class="topNav">
    <div class="itemNav" :class="{active:itemNav.code==item.code}" v-for="(item,index) in navList" :key="index"
      @click="hanldClick(item)">
      <div>{{item.title}}</div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    navList:{
      type: Array,
      default: () =>[]
    },
    itemNav: {
      type: Object,
      default: () =>{}
    },
  },
  data () {
    return {
      
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  updated () {},
  methods: {
    hanldClick(item){
      this.$emit('handleNav',item)
    }
  },
  filters: {},
}
</script>

<style lang="less" scoped>
.topNav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 45px;
  line-height: 45px;
  color: #fff;
  .itemNav{
    width: 100px;
    height: 45px;
    font-size: 20px;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #ffffff;
  }
  .active{
    box-shadow: rgba(202,38,250,0.8) 0px 0px 10px 5px;
  }
}
</style>